package com.goldmantis.alitrip.common;

import com.taobao.api.*;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;

/**
 * @Author:Shmily
 * @Description:
 * @Date:Create in 12:41 2018/1/25
 */
public class BaseService {

    @Value("${url}")
    public String url;

    @Value("${app_key}")
    public String app_key;

    @Value("${app_secret}")
    public String app_secret;

    @Value("${corp_id}")
    public String corp_id;

    @Value("${corp_name}")
    public String corp_name;

    @Value("${accessToken}")
    public String accessToken;


//    public <T> T execute(Function<T, TaobaoClient> func){
//        TaobaoClient client = new DefaultTaobaoClient(url, app_key, app_secret);
//        T callback = func.callback(client);
//
//        TaobaoResponse executeResult = null;
//        try {
//            executeResult = client.execute(callback);
//        } catch (ApiException e) {
//            e.printStackTrace();
//        }
//        return executeResult;
//    }

}
